package com.qf.day11;

import java.util.Arrays;
import java.util.Map;
import java.util.Properties;

public class SystemDemo02 {

    private SystemDemo02(){}

    public static void main(String[] args) {

        System.out.println("hello "+System.lineSeparator()+"world");

//        Integer a = 100;
//        System.out.println(a.hashCode());

        // 获取对象内存地址相关的hashcode
//        System.out.println(System.identityHashCode(a));


        // 获取某个指定的环境变量的值
//        System.out.println(System.getenv("JAVA_HOME"));


//        Map<String, String> getenv = System.getenv();
////        System.out.println(getenv);
//        getenv.forEach( (k,v)-> System.out.println(k+"="+v) );


//        System.gc();

        // 获取全部的系统属性
//        String property = System.getProperty("user.name1","tom");
//        System.out.println(property);

//        String property = System.getProperty("user.name");
//        System.out.println(property);

//        Properties properties = System.getProperties();
//        System.out.println(properties);
//        Object o = properties.get("java.runtime.name");
//        System.out.println(o);
//        properties.forEach( (k,v)-> System.out.println(k+"="+v) );


//        String[] arr = {"三国","水浒","红楼","西游"};
//        System.out.println(Arrays.toString(arr));
        // 删除arr中的 “水浒”,同时把后面的元素向前移动
//        System.arraycopy(arr,2,arr,1,2);
//        System.out.println(Arrays.toString(arr));
//        arr[arr.length-1] = null;
//        System.out.println(Arrays.toString(arr));
//        System system = new System();  // 无法创建System类的对象，因为他的构造是private的
//        SystemDemo02 systemDemo02 = new SystemDemo02();
    }

}
